
#ifndef __MAIN_H
#define __MAIN_H


#include "gd32f1x0.h"

#define GotoAppGuide 0x08004FF0
#define DefaultAppBurnPos 1   //1->APP1 | others->APP2

//Enumeration of received task instructions
enum CommandEnum
{
		CMDIntoBootloaderMode = 0x1F,
    CMDIntoDebugMode = 0x77,
	
		CMDGotoApp1 = 0xA1,CMDGotoApp2 = 0xA2,
		CMDDelApp1 = 0x41,CMDDelApp2 = 0x42,
		
		CMDRestart = 0x1E,
	
};

typedef struct
{
	bool status;
	bool loaderEnd;
	
	uint8_t bootloaderpackage;
	uint8_t bootloaderpackagecount;
	
	uint32_t bootloaderWaitTime;
	uint32_t bootloaderTime;
	
	uint32_t bootloaderbytecount;
	uint32_t bootloaderbitcount;
	
}Bootloader_struct;




#endif
